const express = require('express')
const router = express.Router()

const userinfoHandler = require('../router_handler/userinfo')

const expressJoi = require('@escook/express-joi')
const { update_userinfo_schema, 
	update_pwd_schema,
	update_avatar_schema 
} = require('../schema/userinfo')

// 查询用户信息
router.get('/userinfo', userinfoHandler.getUserInfo)
// 更改用户信息
router.post('/userinfo', expressJoi(update_userinfo_schema), userinfoHandler.updateUserInfo)
// 更改密码
router.post('/updatepwd', expressJoi(update_pwd_schema), userinfoHandler.updatePassword)
// 更改头像
router.post('/update/avatar', expressJoi(update_avatar_schema), userinfoHandler.updateAvatar)


module.exports = router